package example

import (
	"base"
	. "game_server/logic/internal"
	"game_server/model"
	"proto/example"
)

type exampleService struct {
}

func init() {
	Service.Register(new(exampleService))
}

func (*exampleService) Name() string {
	return "proto_example"
}

func (*exampleService) Echo(player *model.Player, msg *proto_example.Echo) (err error) {
	base.Logger.Release("exampleService Echo, Content: %v, Number: %v", msg.Content, msg.Number)

	rpc.OnEcho(player, msg)

	player.Example.Content = msg.Content
	player.Example.Number = int(msg.Number)
	system.OnChange(player)

	return
}
